import request from '@/utils/request'

// 获取随队裁判列表
export function getRefereeList(params) {
  if(params) {
    return request({
      url: `/work/teamreferee/list?page=${params.pageNum}&rowsPerPage=${params.pageSize}`,
      method: 'get'
    })
  } else {
    return request({
      url: `/work/teamreferee/list`,
      method: 'get'
    })
  }
  
}

// 获取可添加裁判列表
export function getAddRefereeList() {
  return request({
    url: '/work/teamreferee/refereeList',
    method: 'get'
  })
}

// 新增裁判
export function insert(data) {
  return request({
    url: '/work/teamreferee/saveOrUpdate',
    method: 'post',
    data:data
  })
}

export function update(data) {
  return request({
    url: '/work/teamreferee/saveOrUpdate',
    method: 'post',
    data:data
  })
}

// 删除裁判
export function batchDelete(params) {
  return request({
    url: '/work/teamreferee/delete-by-id',
    method: 'get',
    params:params
  })
}
// 获取裁判信息
export function getById(params) {
  return request({
    url: '/work/teamreferee/' + params.id,
    method: 'get'
  })
}